﻿<Window x:Class="NewlifeCC.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:NewlifeCC"
        xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
        mc:Ignorable="d"
        Title="MainWindow" Height="745.677" Width="818.303">
    <Window.Resources>
        <local:IsNullOrEmptyConverter x:Key="isNullOrEmpty" />
    </Window.Resources>
    <Grid Margin="0,0,0,7">
        <Grid.ColumnDefinitions>
        </Grid.ColumnDefinitions>
        <Button x:Name="button" Content="New Character" HorizontalAlignment="Left" Margin="19,10,0,0" VerticalAlignment="Top" Width="160" Click="new_button_Click" Height="20"/>
        <ListBox x:Name="charBox" HorizontalAlignment="Left" Height="593" Margin="19,35,0,0" VerticalAlignment="Top" Width="160" SelectionChanged="listBox_SelectionChanged">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal" Background="{Binding Error, Converter={StaticResource isNullOrEmpty}}">
                        <TextBlock Text="(" />
                        <TextBlock Text="{Binding priority}" />
                        <TextBlock Text=") " />
                        <TextBlock Text="{Binding name}" />
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
        <Grid Margin="198,0,10,6" x:Name="charEdit">
            <Label Content="Gender" HorizontalAlignment="Left" Margin="110,10,0,0" VerticalAlignment="Top"/>
            <TextBox Text="{Binding type, Mode=OneWay}" Margin="10,10,0,0" IsEnabled="False" Height="23" Width="100" HorizontalAlignment="Left" VerticalAlignment="Top"/>
            <CheckBox Content="Enabled" HorizontalAlignment="Left" Margin="95,41,0,0" VerticalAlignment="Top" IsChecked="{Binding enabled}"/>
            <Label Content="Priority (Int)" HorizontalAlignment="Left" Margin="110,61,0,0" VerticalAlignment="Top"/>
            <TextBox HorizontalAlignment="Left" Height="23" Margin="10,61,0,0" TextWrapping="Wrap" Text="{Binding priority}" VerticalAlignment="Top" Width="100"/>
            <Label Content="Name" HorizontalAlignment="Left" Margin="110,89,0,0" VerticalAlignment="Top"/>
            <TextBox HorizontalAlignment="Left" Height="23" Margin="10,89,0,0" TextWrapping="Wrap" Text="{Binding name}" VerticalAlignment="Top" Width="100"/>
            <Label Content="Age" HorizontalAlignment="Left" Margin="110,117,0,0" VerticalAlignment="Top"/>
            <ComboBox HorizontalAlignment="Left" Height="23" Margin="10,117,0,0" SelectedItem="{Binding age}" ItemsSource="{Binding ageValues}" VerticalAlignment="Top" Width="100"/>
            <Label Content="Race" HorizontalAlignment="Left" Margin="110,145,0,0" VerticalAlignment="Top"/>
            <TextBox HorizontalAlignment="Left" Height="23" Margin="10,145,0,0" Text="{Binding race, ValidatesOnDataErrors=True}" VerticalAlignment="Top" Width="100"/>
            <Label Content="Eye Colour" HorizontalAlignment="Left" Margin="110,171,0,0" VerticalAlignment="Top"/>
            <xctk:WatermarkTextBox Watermark="Random" HorizontalAlignment="Left" Height="23" Margin="10,171,0,0" Text="{Binding eyeColour, ValidatesOnDataErrors=True}" VerticalAlignment="Top" Width="100"/>
            <Label Content="Hair Colour" HorizontalAlignment="Left" Margin="110,202,0,0" VerticalAlignment="Top"/>
            <xctk:WatermarkTextBox Watermark="Random" HorizontalAlignment="Left" Height="23" Margin="10,202,0,0" Text="{Binding hairColour, ValidatesOnDataErrors=True}" VerticalAlignment="Top" Width="100"/>
            <Label Content="Skin Colour" HorizontalAlignment="Left" Margin="110,233,0,0" VerticalAlignment="Top"/>
            <xctk:WatermarkTextBox Watermark="Random" HorizontalAlignment="Left" Height="23" Margin="10,233,0,0" Text="{Binding skinColour, ValidatesOnDataErrors=True}" VerticalAlignment="Top" Width="100"/>
            <Label Content="Figure" HorizontalAlignment="Left" Margin="110,264,0,0" VerticalAlignment="Top"/>
            <ComboBox HorizontalAlignment="Left" Height="23" Margin="10,261,0,0" SelectedItem="{Binding figure}" ItemsSource="{Binding figureValues}" VerticalAlignment="Top" Width="100"/>
            <Label Content="Personality" HorizontalAlignment="Left" Margin="110,290,0,0" VerticalAlignment="Top"/>
            <ComboBox HorizontalAlignment="Left" Height="23" Margin="10,290,0,0" SelectedItem="{Binding personality}" ItemsSource="{Binding personalityValues}" VerticalAlignment="Top" Width="100"/>
            <CheckBox x:Name="allowAdditionalTraits" Content="Allow Additional Traits" HorizontalAlignment="Left" Margin="95,318,0,0" VerticalAlignment="Top" IsChecked="{Binding allowAdditionalTraits}" Height="36"/>
            <xctk:CheckListBox x:Name="traits"
                DisplayMemberPath="."
                ValueMemberPath="."
                SelectedItemsOverride="{Binding traits}"
                ItemsSource="{Binding traitValues}"
                Margin="243,33,182,5"
                ItemSelectionChanged="traits_ItemSelectionChanged" />
            <Label Content="Traits" HorizontalAlignment="Left" Margin="243,2,0,0" VerticalAlignment="Top"/>
            <Label Content="BlockedTraits" HorizontalAlignment="Left" Margin="423,2,0,0" VerticalAlignment="Top"/>
            <xctk:CheckListBox x:Name="blockedTraits"
                DisplayMemberPath="."
                ValueMemberPath="."
                SelectedItemsOverride="{Binding blockedTraits}"
                ItemsSource="{Binding traitValues}"
                Margin="425,33,0,5" 
                IsEnabled="{Binding ElementName=allowAdditionalTraits, Path=IsChecked}"
                ItemSelectionChanged="blockedTraits_ItemSelectionChanged" HorizontalAlignment="Left" Width="177" />
            <TextBlock x:Name="errorBlock" HorizontalAlignment="Left" Margin="10,343,0,0" TextWrapping="Wrap" Text="{Binding Error, ValidatesOnDataErrors=True, Mode=OneWay}" VerticalAlignment="Top" Height="225" Width="223" FontSize="13.333" Foreground="Red"/>
            <TextBlock x:Name="errorBlock_Copy" HorizontalAlignment="Left" Margin="26,631,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Height="61" Width="188" FontSize="13.333" TextAlignment="Center">
                Learning a lot about NewLife? Come help contribute to the
                <Hyperlink NavigateUri="http://new-life.wikia.com/wiki/New_Life_Wikia" RequestNavigate="Hyperlink_RequestNavigate">New Life Wikia</Hyperlink>
            </TextBlock>

        </Grid>
        <Button x:Name="button_Copy" Content="Export/Save Characters" HorizontalAlignment="Left" Margin="19,658,0,0" VerticalAlignment="Top" Width="160" Click="save_button_Click" Height="20"/>
        <Button x:Name="button_Delete" Content="Delete Character" HorizontalAlignment="Left" Margin="19,633,0,0" VerticalAlignment="Top" Width="160" Click="button_Delete_Click"/>
    </Grid>
</Window>
